<?php

// 获取投资机构列表
// GET organization.volist

namespace app\api\resource\organization;
use think\Db;

class Volist
{
    // 方法
    public $_method = ['GET'];
    // 前置
    public $_pre    = [];
    // 描述
    public $_description = '获取投资机构列表';
    // 参数
    public $_param  = [
        'model'  => '模式,0-简单模式(默认) | 1-详细模式',
        'status' => '状态,0-已认证的（默认）1-未认证的',
    ];
    // 返回
    public $_return = [
        200 => '获取成功',
    ];

    public function run(&$request)
    {
        $model  = $request->get('model/d',0,'abs');
        $status = $request->get('status/d',0,'abs');

        $field = (0 == $model) ? 'title,logo' : ''; 
        $list  = Db::name('organization')->where('status',$status)->field($field)->select();

        return [200,$list];
    }
}